﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>条码出入库记录明细</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/Content/X-admin/css/font.css" rel="stylesheet" />
    <script src="~/Content/X-admin/lib/layui/layui.js"></script>
    <link href="~/Content/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/Content/X-admin/js/jquery.min.js"></script>
    <script src="~/Content/X-admin/js/xadmin.js"></script>
    <script src="~/Content/Scripts/System/systemFrame.js"></script>
    <script src="~/Content/Scripts/System/Common.js"></script>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
              
                    <form class="layui-form layui-col-space5" name="qForm" id="qForm">

                        <input type="hidden" name="mCode" id="mCode" />
                    </form>
                    <div class="layui-card-body layui-table-body layui-table-main">
                        <table class="layui-hide" id="list" lay-filter="list"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>

<script>

    function loadData() {
        layui.use('table', function () {

            var conditon = JSON.stringify(FormToJson("qForm"));
            var table = layui.table;
            table.render({
                elem: '#list'
            , cols: [[ //标题栏
              { field: 'id', title: 'ID', width: 80 }
                , { field: 'barCode', align: 'center', title: '条码', width: '12%' }
                , { field: 'proCode', align: 'center', title: '存货编码', width: '12%', }
                , { field: 'proName', align: 'center', title: '存货名称', width: '12%' }
                , { field: 'spec', align: 'center', title: '规格', width: '12%' }
                , { field: 'proWeight', align: 'center', title: '重量', width: '12%' }
                , { field: 'houseName', align: 'center', title: '所属仓库', width: '11%' }
                , { field: 'barStatusName', align: 'center', title: '条码状态', width: '11%' }
                , { field: 'userName', align: 'center', title: '生产人员', width: '10s%' }
                , { field: 'createtime', align: 'center', title: '扫码时间', width: '15%' }
            ]], done: function (res, curr, count) {
                $("[data-field='id']").css('display', 'none');//隐藏列
                if (inOutType == "pawcarin" || inOutType == "poscarout" ) {
                    $("[data-field='proCode']").css('display', 'none');//隐藏列
                    $("[data-field='proName']").css('display', 'none');//隐藏列
                    $("[data-field='number']").css('display', 'none');//隐藏列
                    $("[data-field='color']").css('display', 'none');//隐藏列
                    $("[data-field='trademark']").css('display', 'none');//隐藏列
                    $("[data-field='wareHouseName']").css('display', 'none');//隐藏列
                    $("[data-field='barStatusName']").css('display', 'none');//隐藏列
                }
            }
           
            , url: "../Bar/GetDataList?dataType=reList&condition=" + conditon
            , skin: 'row' //表格风格
            , even: true
            , page: false //是否显示分页
            , limits: [10, 15, 20]
            , limit: 10 //每页默认显示的数量
            });
            //监听工具条
            table.on('tool(list)', function (obj) {
                var data = obj.data;
                if (data.barType == "Box") {
                    if (obj.event === 'view') {
                        InfoOpenPage('../Bar/InBoxBars?boxCode=' + data.barCode, data.barCode + "-箱码", "85%", "90%");
                    }
                }

            });
        });
   
    }

    var inOutType = "";

    $(function () {
        var dataId = getUrlVariable("mCode");
        inOutType = getUrlVariable("inOutType");

        if (dataId != undefined && dataId != "") {
            $("input[ name='mCode']").val(dataId);
            loadData();
        }
    
    })

</script>